import re
import math


file = open("mf.txt") 
outfile = open("compression_data.txt","w")
for line in file:
	#spline=re.split('\[|\]|,',line)
	#print spline
	#print re.search("dog",line)
	num=0
	if re.search("person",line)!=None:
		num=math.pow(2,31)+num
	if re.search("bowl",line)!=None:
		num=math.pow(2,30)+num
	if re.search("bottle",line)!=None:
		num=math.pow(2,29)+num
	if re.search("cat",line)!=None:
		num=math.pow(2,28)+num
	if re.search("dog",line)!=None:
		num=math.pow(2,27)+num
	if re.search("phone",line)!=None:
		num=math.pow(2,26)+num
	if re.search("book",line)!=None:
		num=math.pow(2,25)+num
	if re.search("monkey",line)!=None:
		num=math.pow(2,24)+num
	if re.search("money",line)!=None:
		num=math.pow(2,23)+num
	if re.search("glass",line)!=None:
		num=math.pow(2,22)+num
	if re.search("umbrella",line)!=None:		
		num=math.pow(2,21)+num
	print num
	print >> outfile, "%d" % int(num)
	#outfile.write(num)
